package poo.file;

import java.io.*;

public class Copia {

	public static void main(String[] args) throws IOException {

		InputStream source = new FileInputStream("f1.dat");
		OutputStream dest = new FileOutputStream("f2.dat");

		int dato; // notare la dichiarazione
		for (;;) {
			dato = source.read();
			if (dato == -1)
				break; // end of file di f1
			dest.write(dato);
		}// for
		source.close();
		dest.close();

	}

}
